<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:p="http://primefaces.org/ui"
                template="/templates/ui.xhtml">
    <ui:define name="head">
        <script type="text/javascript" src="#{request.contextPath}/UI/support/pub.js"/>
        <script type="text/javascript" language="javascript">
            document.onkeydown = function TabReplace() {
                if (event.keyCode == 13) {
                    if (event.srcElement.tagName != 'BUTTON')
                        event.keyCode = 9;
                    else
                        event.srcElement.click();
                }
            }


        </script>
        <style type="text/css">
            .c_c {
                background: gray;
            }

            .p_c {
                background: green;
            }
        </style>
    </ui:define>
    <ui:define name="content">
        <div style="margin:5px;">
            <h:form id="form">
                <!-- <input type="button"  onclick="javascript:method1('pdt');"  value="第一种方法导入到EXCEL" />

                 <input type="button"  onclick="javascript:method2('pdt');"  value="第二种方法导入到EXCEL" />

                 <input type="button"  onclick="javascript:getXlsFromTbl('pdt',null);"  value="第三种方法导入到EXCEL" />
 -->
                <p:growl id="msgs" showDetail="false"/>
                <p:ajaxStatus style="width:16px;height:16px;">
                    <f:facet name="start">
                        <h:graphicImage value="/images/ajaxloading.gif"/>
                    </f:facet>
                    <f:facet name="complete">
                        <h:outputText value=""/>
                    </f:facet>
                </p:ajaxStatus>
                <p:panel header="分包合同工程价格结算" style="width: 100%">
                    <p:dataTable id="pdt" style="width:100%;"
                                 value="#{itemHieRelapStlEngPAction.itemStlSubcttEngPMngList}"
                                 var="record"
                                 rowKey="#{record.subctt_Pkid}"
                                 selectionMode="single"
                                 paginatorTemplate="{FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink}
                                            {LastPageLink} {RowsPerPageDropdown}"
                                 paginator="true"
                                 paginatorPosition="bottom"
                                 rows="100"
                                 rowsPerPageTemplate="200,100,50,40,30,20,10"
                                 rowIndexVar="row"
                                 emptyMessage="数据记录为空..."
                                 rowStyleClass="#{record.subctt_Name eq '小计'? 'c_c':
                                                 record.subctt_Name eq '本期净结算额'? 'p_c':
                                                 record.subctt_Name eq '合计(扣除其它栏款项后本期结算价值)'?'p_c':
                                                 record.subctt_Name eq '其中:安全施工措施费'?'c_c':
                                                 record.subctt_Name eq '质保金'? 'p_c':null}"
                                 stickyHeader="#{itemHieRelapStlEngPAction.strStickyHeaderFlag}">
                        <f:facet name="header">
                            <div style="text-align: right">
                                <p:outputLabel value="#{itemHieRelapStlEngPAction.esStlSubcttEngHeader.strDate}"/>
                            </div>
                        </f:facet>

                        <p:columnGroup type="header">
                            <p:row>
                                <p:column headerText="工程名称"/>
                                <p:column colspan="4"
                                          headerText="#{itemHieRelapStlEngPAction.esStlSubcttEngHeader.strTkcttName}"
                                          style="text-align: left"/>
                                <p:column headerText="结算单编号"/>
                                <p:column colspan="6"
                                          headerText="#{itemHieRelapStlEngPAction.esStlSubcttEngHeader.strStlId}"
                                          style="text-align: left"/>
                            </p:row>

                            <p:row>
                                <p:column headerText="工程项目"/>
                                <p:column colspan="4"
                                          headerText="#{itemHieRelapStlEngPAction.esStlSubcttEngHeader.strSubcttName}"
                                          style="text-align: left"/>
                                <p:column headerText="协作合同编号"/>
                                <p:column colspan="6"
                                          headerText="#{itemHieRelapStlEngPAction.esStlSubcttEngHeader.strSubcttId}"
                                          style="text-align: left"/>
                            </p:row>

                            <p:row>
                                <p:column headerText="协作队伍"/>
                                <p:column colspan="11"
                                          headerText="#{itemHieRelapStlEngPAction.esStlSubcttEngHeader.strSignPartName}"
                                          style="text-align: left"/>
                            </p:row>

                            <p:row>
                                <p:column rowspan="2" headerText="序号"/>
                                <p:column rowspan="2" headerText="编号"/>
                                <p:column rowspan="2" headerText="分项项目名称"/>
                                <p:column rowspan="2" headerText="单位"/>
                                <p:column rowspan="2" headerText="合同单价"/>
                                <p:column rowspan="2" headerText="合同数量"/>
                                <p:column rowspan="2" headerText="合同金额"/>
                                <p:column colspan="2" headerText="本期"/>
                                <p:column colspan="2" headerText="开累"/>
                                <p:column rowspan="2" headerText="备注内容"/>
                            </p:row>
                            <p:row>
                                <p:column headerText="数量"/>
                                <p:column headerText="金额"/>
                                <p:column headerText="数量"/>
                                <p:column headerText="金额"/>
                            </p:row>
                        </p:columnGroup>

                        <p:column>
                            <h:outputText value="#{row + 1}"/>
                        </p:column>

                        <p:column>
                            <h:outputText value="#{record.subctt_StrNo}" escape="false"/>
                        </p:column>

                        <p:column>
                            <h:outputText value="#{record.subctt_Name}"/>
                        </p:column>

                        <p:column>
                            <h:outputText value="#{record.subctt_Unit}" style="text-align:right"/>
                        </p:column>

                        <p:column>
                            <h:outputText value="#{record.subctt_ContractUnitPrice}" style="float: right">
                                <f:convertNumber type="number" pattern="#,###,###,###,##0.00"/>
                            </h:outputText>
                        </p:column>

                        <p:column>
                            <h:outputText value="#{record.subctt_ContractQuantity}" style="float: right">
                                <f:convertNumber type="number" pattern="#,###,###,###,##0.00"/>
                            </h:outputText>
                        </p:column>

                        <p:column>
                            <h:outputText value="#{record.subctt_ContractAmount}" style="float: right">
                                <f:convertNumber type="number" pattern="#,###,###,###,##0.00"/>
                            </h:outputText>
                        </p:column>

                        <p:column>
                            <h:outputText value="#{record.engPMng_CurrentPeriodEQty}" style="float: right">
                                <f:convertNumber type="number" pattern="#,###,###,###,##0.00"/>
                            </h:outputText>
                        </p:column>

                        <p:column>
                            <h:outputText value="#{record.engPMng_CurrentPeriodAmt}" style="float: right">
                                <f:convertNumber type="number" pattern="#,###,###,###,##0.00"/>
                            </h:outputText>
                        </p:column>

                        <p:column>
                            <h:outputText value="#{record.engPMng_BeginToCurrentPeriodEQty}" style="float: right">
                                <f:convertNumber type="number" pattern="#,###,###,###,##0.00"/>
                            </h:outputText>
                        </p:column>

                        <p:column>
                            <h:outputText value="#{record.engPMng_BeginToCurrentPeriodAmt}" style="float: right">
                                <f:convertNumber type="number" pattern="#,###,###,###,##0.00"/>
                            </h:outputText>
                        </p:column>

                        <p:column>
                            <h:outputText value="#{record.subctt_Note}"/>
                        </p:column>
                    </p:dataTable>
                </p:panel>
            </h:form>
        </div>
    </ui:define>
</ui:composition>